package cn.chinaunicom.sdsi.gacx.projApply.service.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import cn.chinaunicom.sdsi.frm.sys.R;
import cn.chinaunicom.sdsi.frm.sys.entity.SysStaff;
import cn.chinaunicom.sdsi.frm.sys.entity.SysStaffOrg;
import cn.chinaunicom.sdsi.gacx.projApply.dao.mybatis.projApplyMapper;
import cn.chinaunicom.sdsi.gacx.projApply.entity.TravelApplyEntity;
import cn.chinaunicom.sdsi.gacx.projApply.entity.TravelApplyFileEntity;
import cn.chinaunicom.sdsi.gacx.projApply.service.projApplyService;


/**
 * @author xp
 * 2018-03-12
 */
@Service
public class projApplyServiceImpl implements projApplyService {

	@Autowired
	private projApplyMapper projApplyMapper;
	
	@Override
	public int addTravel(TravelApplyEntity travelApplyEntity){
		try{
			int i = projApplyMapper.addTravel(travelApplyEntity);
			return i;
		}catch(Exception e){
			e.printStackTrace();
			return 0;
		}
	}
	
	@Override
	public int deleteTravelFileByHand(String projId,String oldFileName){
		int i = 0;
		try{
			i = projApplyMapper.deleteTravelFileByHand(projId, oldFileName);
			return i;
		}catch(Exception e){
			e.printStackTrace();
			return 0;
		}
	}
	
	@Override
	public void deleteTravelFile(String projId){
		try{
			projApplyMapper.deleteTravelFile(projId);
		}catch(Exception e){
			e.printStackTrace();
		}
	}
	
	@Override
	public void addTravelFile(TravelApplyFileEntity travelApplyFileEntity){
		try{
			projApplyMapper.addTravelFile(travelApplyFileEntity);
		}catch(Exception e){
			e.printStackTrace();
		}
	}
}
